package com.maplefire.controller;


import com.maplefire.message.CollectPush2RetailMsg;
import com.maplefire.message.SmilePush2RetailMsg;
import com.maplefire.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: maplefire
 * @Description:
 * @Date: 2021/5/18 17:30
 */
@RestController
@RequestMapping(value = "/test")
public class TestController {
    @Autowired
    private MessageService messageService;

    @RequestMapping(value = "/applyOrder")
    public String acceptOrder(@RequestBody CollectPush2RetailMsg crMsg) {
        messageService.doHandler(crMsg.getOperation(), crMsg.getSource(), crMsg);
        return "success";
    }

    @RequestMapping(value = "/boundOrder")
    public String boundOrder(@RequestBody CollectPush2RetailMsg crMsg) {
        messageService.doHandler(crMsg.getOperation(), crMsg.getSource(), crMsg);
        return "success";
    }

    @RequestMapping(value = "/updateMailNo")
    public String boundOrder(@RequestBody SmilePush2RetailMsg srMsg) {
        messageService.doHandler(srMsg.getOperation(), srMsg.getSource(), srMsg);
        return "success";
    }
}
